package com.gitee.qdbp.base.shiro.token;

import org.apache.shiro.authc.UsernamePasswordToken;
import com.gitee.qdbp.base.system.model.IAccount;

/**
 * 已认证用户登录Token
 *
 * @author zhaohuihua
 * @version 170815
 */
public class AuthedLoginToken extends UsernamePasswordToken {

    /** 版本序列号 **/
    private static final long serialVersionUID = 1L;

    private IAccount account;

    public AuthedLoginToken(IAccount account) {
        this(account, false, null);
    }

    public AuthedLoginToken(IAccount account, boolean rememberMe, String host) {
        super();
        this.account = account;
        this.setPassword("PASSWORD".toCharArray()); // 给一个固定密码模拟登录
        this.setRememberMe(rememberMe);
        this.setHost(host);
    }

    public IAccount getAccount() {
        return account;
    }
}
